]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenShield: Rework key focus management
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Mon, 2 Dec 2019 15:35:00 +0000 (12:35 -0300)
committerFlorian Müllner <florian.muellner@gmail.com>
Mon, 10 Feb 2020 22:30:52 +0000 (22:30 +0000)
Instead of always grabbing key focus for the screen lock
group, do that for the unlock dialog itself.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/872

js/ui/screenShield.js
js/ui/unlockDialog.js

index b534a7b02fcc4fc7691c6ef9d1625a78b32cfac1..4cb7f249df63e84777c2d248bb5f232577cd6643 100644 (file)
@@ -57,11 +57,14 @@ var ScreenShield = class {
         });
         Main.ctrlAltTabManager.addGroup(this._lockScreenGroup, _("Lock"), 'changes-prevent-symbolic');
 
-        this._lockDialogGroup = new St.Widget({ x_expand: true,
-                                                y_expand: true,
-                                                reactive: true,
-                                                pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }),
-                                                name: 'lockDialogGroup' });
+        this._lockDialogGroup = new St.Widget({
+            x_expand: true,
+            y_expand: true,
+            reactive: true,
+            can_focus: true,
+            pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }),
+            name: 'lockDialogGroup',
+        });
 
         this.actor.add_actor(this._lockScreenGroup);
         this.actor.add_actor(this._lockDialogGroup);
@@ -173,7 +176,7 @@ var ScreenShield = class {
             // LoginDialog.cancel() will grab the key focus
             // on its own, so ensure it stays on lock screen
             // instead
-            this._lockScreenGroup.grab_key_focus();
+            this._dialog.grab_key_focus();
         }
     }
 
@@ -434,7 +437,7 @@ var ScreenShield = class {
             this._lockScreenShown({ fadeToBlack, animateFade: false });
         }
 
-        this._lockScreenGroup.grab_key_focus();
+        this._dialog.grab_key_focus();
     }
 
     _lockScreenShown(params) {
index 9b8cfd935286f2132e1128599ac583ed9fb406fd..55dfa2cc4f1bfef6f19fac6b0df0f559b4cf379f 100644 (file)
@@ -418,6 +418,7 @@ var UnlockDialog = GObject.registerClass({
             accessible_role: Atk.Role.WINDOW,
             style_class: 'login-dialog',
             visible: false,
+            can_focus: true,
             reactive: true,
         });